/*
 * Powered By dico
 * Since 2017 - 2018
 */package com.seeyoui.kensite.bussiness.orderlang.userAddress.service;
 
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.seeyoui.kensite.common.base.service.BaseService;

import java.util.*;

import com.seeyoui.kensite.common.base.domain.EasyUIDataGrid;
import com.seeyoui.kensite.common.base.service.BaseService;
import com.seeyoui.kensite.common.exception.CRUDException;
import com.seeyoui.kensite.common.util.*;
import com.seeyoui.kensite.common.constants.StringConstant;
import com.seeyoui.kensite.bussiness.orderlang.userAddress.domain.UserAddress;
import com.seeyoui.kensite.bussiness.orderlang.userAddress.persistence.UserAddressMapper;

/**
 * UserAddress
 * @author dico
 * @version 2.0
 * @since 1.0
 * @date 2018-02-07
 */

@Service
public class UserAddressService extends BaseService {
	
	@Autowired
	private UserAddressMapper userAddressMapper;

	/**
	 * 根据ID查询单条数据
	 * @param id
	 * @return
	 * @throws CRUDException
	 */
	public UserAddress findOne(String id) throws CRUDException{
		return userAddressMapper.findOne(id);
	}
	
	/**
	 * 查询数据集合
	 * @param userAddress
	 * @return
	 * @throws CRUDException
	 */
	public List<UserAddress> findList(UserAddress userAddress) throws CRUDException {
		return userAddressMapper.findList(userAddress);
	}
	
	/**
	 * 查询所有数据集合
	 * @param userAddress
	 * @return
	 * @throws CRUDException
	 */
	public List<UserAddress> findAll(UserAddress userAddress) throws CRUDException {
		return userAddressMapper.findAll(userAddress);
	}
	
	/**
	 * 查询数据总数
	 * @param userAddress
	 * @return
	 * @throws CRUDException
	 */
	public int findTotal(UserAddress userAddress) throws CRUDException {
		return userAddressMapper.findTotal(userAddress);
	}
	
	/**
	 * 查询数据总数排除当前数据
	 * @param userAddress
	 * @return
	 * @throws CRUDException
	 */
	public int findExTotal(UserAddress userAddress) throws CRUDException {
		return userAddressMapper.findExTotal(userAddress);
	}
	
	/**
	 * 数据新增
	 * @param userAddress
	 * @throws CRUDException
	 */
	public void save(UserAddress userAddress) throws CRUDException{
		userAddress.preInsert();
		userAddressMapper.save(userAddress);
	}
	
	/**
	 * 数据修改
	 * @param userAddress
	 * @throws CRUDException
	 */
	public void update(UserAddress userAddress) throws CRUDException{
		userAddress.preUpdate();
		userAddressMapper.update(userAddress);			
	}
	
	/**
	 * 数据删除
	 * @param listId
	 * @throws CRUDException
	 */
	public void delete(List<String> listId) throws CRUDException {
		userAddressMapper.delete(listId);
	}
	
	/**
	 * 数据假删除
	 * @param userAddress
	 * @throws CRUDException
	 */
	public void remove(UserAddress userAddress) throws CRUDException{
		userAddress.preUpdate();
		userAddressMapper.remove(userAddress);			
	}
	
}